#ifndef PROCESS_HPP_
#define PROCESS_HPP_

#define PROCESS_SIGNATURE ('PROC')

class Scheduler;
class Session;
class Team;
class Process;
class Thread;

template<class T> class TList;

enum
{
	PROCESS_CREATED = 0,
	PROCESS_READY,
	PROCESS_RUNNING,
	PROCESS_WAITING,
	PROCESS_EXITING,
	PROCESS_FINISHED,
	PROCESS_PANIC,
};

class Process
{
friend class Scheduler;
friend class Session;
friend class Team;
friend class Thread;
public:
	Process( const char * name, Team * team );	
	~Process();

private:
#if PARANOID
	uint32 signature;
#endif

	Team * team;
	char * name;
	uint32 status;
	uint32 flags;
	uint32 priority;
	char ** arguments;
	uint32	argumentCount;
	int		result;
	Thread * mainThread;
	TList<Thread> * threads;
	Process * parent;
	TList<Process> * children;
};

#endif /*PROCESS_HPP_*/
